import cgi
import os
import time
import datetime

def createAttribute(name, value):
    s = ' ' + name + '="' + value + '"' + ' '
    return s

def createXmlElement(elementName, attributes, values, text):
    s = '\n<%s ' % elementName
    n = len(attributes)
    for i in range(1, n):
        s = s + createAttribute(self, attribute[i], values[i])
    if text:
        s + s + ' >\n' + text + '</'+elementName+' >\n'
    else:    
        s + s + ' />\n'

